package com.gitbl.webchat.web.webmessage;

import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

public class WebError implements Serializable {
    String msg;
    int code;
    public WebError(int code, String msg){
        this.code = code;
        this.msg = msg;
    }
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public final static WebError NOTLOGIN=new WebError(1,"not login");
    public final static WebError LOGINFAULT=new WebError(2,"login fault");
    public final static WebError VALIDATEINPUT=new WebError(3,"invalidate");
    public final static WebError CREATEFAULT=new WebError(4,"create fault");
    public final static WebError QUERYFAULT=new WebError(4,"query fault");
    public final static WebError PARAMSERROR=new WebError(5,"params error");
    public final static String STR_NOTLOGIN = JSONObject.toJSONString(new Message(null,NOTLOGIN));
    public final static String STR_PARAMSERROR = JSONObject.toJSONString(new Message(null,PARAMSERROR));

}
